import request from '@/utils/request'

export function apiEditProductCode(data,loading) {
    return request({
        url: "/mes/specificationTaskController/editProductCode",
        method: 'post',
        data: data,
        loading
    })
}

export function apiAddProcessCard(params,loading) {
    return request({
        url: "/mes/processCardController/add",
        method: "post",
        data: params,
        loading
    });
}

export function apiGetInstallItems(params,loading) {
    return request({
        url: "/mes/workInstallItemController/list",
        method: "get",
        params,
        loading
    });
}

export function apiGetMaterial(params,loading) {
    return request({
        url: "/mpm/processController/listMaterial",
        method: "post",
        data: params,
        loading
    });
}
export function apiGetMaterialHasInstall(params,loading) {
    return request({
        url: "/mes/workInstallItemController/listMaterial",
        method: "get",
        params,
        loading
    });
}

export function apiAddOrEditForMaterial(params,loading) {
    return request({
        url: "/mes/workInstallItemController/addOrEditForMaterial",
        method: "post",
        data: params,
        loading
    });
}

export function apiEditForMaterial(params,loading) {
    return request({
        url: "/mes/workInstallItemController/edit",
        method: "put",
        data: params,
        loading
    });
}

export function apiDelMaterial(id,loading) {
    return request({
        url: "/mes/workInstallItemController/"+id,
        method: "delete",
        loading
    });
}

export function apiListMapProcess(params,loading) {
    return request({
        url: "/mes/processTaskController/listMpmDefineDeviceByProcess",
        method: "get",
        params,
        loading
    });
}
//控制安装记录是否可以编辑
export function apiCheckCanEdit(data,loading) {
    return request({
        url: "/mes/workInstallItemController/checkCanEdit",
        method: "post",
        data:data,
        autoUntie: false,
        loading
    });
}
